import Vue from 'vue'
import App from './App.vue'

//引入并注册路由器
import router from '@/router/index'
// 引入并注册仓库
import store from './store'

// 引入加载amfe-flexible
import 'amfe-flexible'

// 全局引入searchBar
import searchBar from '@/components/searchBar'
Vue.component('searchBar', searchBar)
// 全局引入tabBar
import tabBar from '@/components/tabBar'
Vue.component('tabBar',tabBar)

//引入并安装vant  这里目前是完整引入
import Vant from 'vant'
import 'vant/lib/index.css'
import { Lazyload } from 'vant';
Vue.use(Lazyload);
import { Dialog } from 'vant';

// 全局注册
Vue.use(Dialog);

import { Icon ,Grid, GridItem,NavBar,Button,Toast,Badge } from 'vant';
Vue.use(Vant)
Vue.use(Icon)
Vue.use(Grid);
Vue.use(GridItem);
Vue.use(NavBar);
Vue.use(Button)
Vue.use(Toast);
Vue.use(Badge);

//引入全部的请求函数[用对象包含全部的请求函数]
import ajax from '@/api'



//关闭开发提示
Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router,
  store,
  beforeCreate() {
    Vue.prototype.$ajax = ajax
    Vue.prototype.$bus = this
  }
}).$mount('#app')
